package io;

import java.io.File;

public class Demo3 {
    public static void main1(String[] args) {
        File file=new File("C:\\");
        String[] f=file.list();
        if(f==null){
            System.out.println("空目录");
            return;
        }
        for (String s : f) {
            System.out.println(s);
        }
    }

    public static void main2(String[] args) {
        File file=new File("C:\\");
        File[] f=file.listFiles();
        if(f==null){
            System.out.println("空目录");
            return;
        }
        for (File s : f) {
            System.out.println(s);
        }
    }

    public static void main3(String[] args) {
        File file=new File("./fff");
        System.out.println(file.isDirectory());
        boolean ret=file.mkdir();
        System.out.println("ret="+ret);
        System.out.println(file.isDirectory());
    }

    public static void main(String[] args) {
        File file=new File("./ggg/nnn/ddd");
        System.out.println(file.isDirectory());
        System.out.println(file.mkdirs());
        System.out.println(file.isDirectory());
    }
}
